<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>行情数据</title>
</head>

<!--layui的CSS样式-->
<link type="text/css" rel="stylesheet" href="../lib/layuimini/lib/layui-v2.5.5/css/layui.css"/>
<!--layui的js-->
<script src="../lib/layuimini/lib/layui-v2.5.5/layui.js"></script>
<!--第三方下拉表格js-->
<script src="../lib/layuimini/js/lay-config.js"></script>
<!--自己js的路径-->
<script type="text/javascript" src="./js/marketData.js"></script>




<script type="text/html" id="toolEventDemo">
    <a class="layui-btn layui-btn-xs" style="background-color: #1E9FFF" lay-event="edit"><i
            class="layui-icon">&#xe642;</i>编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
            class="layui-icon">&#xe640;</i>删除</a>
</script>


<body>


<!--表格元素 lay-filter 通过这个属性来筛选绑定的表格-->
<table id="mytable" lay-filter="mytable"></table>

<!--上方工具条-->
<!--lay-event 是跟js的Switch case 后的名字一样的-->
<script type="text/html" id="marketDataToolBar">
    <div style="float:right">
        <button class="layui-btn layui-btn-normal layui-btn layui-btn-sm" lay-event="shangHai" id="shangHai">
            <i class="layui-icon">&#xe654;</i>导入上海行情
        </button>
        <button class="layui-btn layui-btn-normal layui-btn layui-btn-sm" lay-event="add">
            <i class="layui-icon">&#xe654;</i>添加行情
        </button>
        <button class="layui-btn layui-btn-primary layui-btn layui-btn-sm" lay-event="deleteAll" style="color: #FF0000">
            <i class="layui-icon">&#xe640;</i>批量删除
        </button>
    </div>


    <!--  form表单  -->
    <!--   采用证券编号和日期来进行模糊查询-->
    <form class="layui-form layui-col-space5">

        <!--   采用证券编号来进行模糊查询-->
        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">证券编号</label>
        </div>
        <div class="layui-inline layui-show-xs-block">
            <input class="layui-input" autocomplete="off" placeholder="请输入证券编号" name="securityId" id="securityId">
        </div>

        <!--采用日期来进行模糊查询-->
        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">日期</label>
        </div>
        <div class="layui-inline layui-show-xs-block">
            <input  type="text" autocomplete="off" class="layui-input dateStr" lay-verify="date" name="time" id="time" placeholder="请输入日期">
        </div>


        <!-- 模糊查询的按钮  -->
        <!-- type="button 这个是为了不让layui提交两次-->
        <div class="layui-inline layui-show-xs-block">
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-event="search"
                    lay-filter="sreach" type="button"><i class="layui-icon">&#xe615;</i>搜索
            </button>
        </div>
    </form>
</script>

<!--限制新增用户的时候用户输入的年龄 最小为1 最大为100岁 ：加了约束-->
<script type="text/javascript">
    function minmax(value, min, max)
    {
        if(parseInt(value) < min || isNaN(parseInt(value)))
            return min;
        else if(parseInt(value) > max)
            return max;
        else return value;
    }
</script>




<!--行情数据新增窗口-->
<div id="addMarket" style="width:100%;display: none; text-align: center;margin-top: 20px">
    <form id="addForm" class="layui-form layui-form-pane" style="display: inline-block" action="">
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">证券编号</label>
<!--            这里的证券名称，不是文本框，是文本框里有个下拉表格
                虽然这里是显示证券名称，但是还是是新增id，只是提示信息是输入证券名称罢了，再通过下拉表格选择证券-->
            <div class="layui-input-inline">
                <input type="text" name="securityId" id="securityId1" lay-verify="required"
                       placeholder="请输入证券编号" autocomplete="off" class="layui-input" >
            </div>
        </div>

<!--        日期框-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">日期</label>
        <div class="layui-input-inline">
            <input  type="text" autocomplete="off" class="layui-input dateStr1" lay-verify="date" name="time" placeholder="请输入日期">
        </div>
        </div>

<!--        开盘价格-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray">开盘价格</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="openingPrice" lay-verify="required"
                       placeholder="请输入开盘价格" autocomplete="off" class="layui-input">
            </div>
        </div>

<!--        收盘价格-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray">收盘价格</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="closingPrice" lay-verify="required"
                       placeholder="请输入收盘价格" autocomplete="off" class="layui-input">
            </div>
        </div>

        <!--        下拉列表，基金id-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray">基金编号</label>
            <div class="layui-input-inline">
            <select name="fundId" lay-verify="">
                <option value="">基金编号</option>
                <option value="159934">159934</option>
                <option value="159935">159935</option>
            </select>
            </div>
        </div>

<!--        描述-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray" style="height: 100px;line-height: 100px">描述</label>
            <div class="layui-input-inline">
                <!--                文本域填地址-->
                <textarea name="remark" required lay-verify="required"  class="layui-textarea" style="height: 60px;width: 190px"></textarea>
            </div>
        </div>



        <div class="layui-form-item" >
            <button class="layui-btn"  style="background-color: #1E9FFF" lay-submit="" lay-filter="addMarket" >
                <i class="layui-icon">&#x1005;</i>添加
            </button>
            <button class="layui-btn layui-btn-primary" type="button" onclick="quxiao()" style="color: #FF0000">
                <i class="layui-icon">&#x1006;</i>取消
            </button>
        </div>
    </form>
</div>


<!--行情数据修改窗口-->
<div id="updateMarket" style="width:100%;display: none; text-align: center;margin-top: 20px">
    <form id="updateForm" class="layui-form layui-form-pane" lay-filter="myFrom2" style="display: inline-block" action="">

        <!--        行情数据id-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray">行情数据ID</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="marketId" lay-verify="required"
                       placeholder="请输入开盘价格" autocomplete="off" class="layui-input" readonly>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">证券编号</label>
            <!--            这里的证券名称，不是文本框，是文本框里有个下拉表格
                            虽然这里是显示证券名称，但是还是是新增id，只是提示信息是输入证券名称罢了，再通过下拉表格选择证券-->
            <div class="layui-input-inline">
                <input type="text" name="securityId" id="securityId2" lay-verify="required"
                       placeholder="请输入证券编号" autocomplete="off" class="layui-input">
            </div>
        </div>

        <!--        日期框-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">录入日期</label>
            <div class="layui-input-inline">
                <input  type="text" autocomplete="off" class="layui-input dateStr2" lay-verify="date" name="time" placeholder="请输入日期">
            </div>
        </div>

        <!--        开盘价格-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray">开盘价格</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="openingPrice" lay-verify="required"
                       placeholder="请输入开盘价格" autocomplete="off" class="layui-input">
            </div>
        </div>

        <!--        收盘价格-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray">收盘价格</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="closingPrice" lay-verify="required"
                       placeholder="请输入收盘价格" autocomplete="off" class="layui-input">
            </div>
        </div>

        <!--        描述-->
        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray" style="height: 100px;line-height: 100px">描述</label>
            <div class="layui-input-inline">
                <!--                文本域填地址-->
                <textarea name="remark" required lay-verify="required"  class="layui-textarea" style="height: 60px;width: 190px"></textarea>
            </div>
        </div>


        <div class="layui-form-item" >
            <button class="layui-btn"  style="background-color: #1E9FFF" lay-submit="" lay-filter="updateMarket" >
                <i class="layui-icon">&#x1005;</i>修改
            </button>
            <button class="layui-btn layui-btn-primary" type="button" onclick="quxiao()" style="color: #FF0000">
                <i class="layui-icon">&#x1006;</i>取消
            </button>
        </div>
    </form>
</div>

</body>
</html>